home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group93a.txt
/
000067_icon-group-sender _Mon Feb 15 20:34:50 1993.msg
< prev
next >
Wrap
Internet Message Format
|
1993-04-21
|
850b
Received: by cheltenham.cs.arizona.edu; Tue, 16 Feb 1993 05:24:37 MST
Date: 15 Feb 93 20:34:50 GMT
From: devries@arizona.edu (K'vin D'Vries)
Organization: U of Arizona CS Dept, Tucson
Subject: A neat ICON trick
Message-Id: <32341@optima.cs.arizona.edu>
Sender: icon-group-request@cs.arizona.edu
To: icon-group@cs.arizona.edu
Status: R
Errors-To: icon-group-errors@cs.arizona.edu
I was working w/ a case stmt:
case x of {
<0 : foo()
>1 : bar()
1 : foobar()
0 : barfoo()
}
but, this won't compile because '<0' and '>1' aren't full expr's. But you
can fix it by:
case x of {
0>x : foo()
1<x : bar()
1 : foobar()
0 : barfoo()
}
This works, since 0>x or 1<x returns 'x' when either one of them succeeds; the
case stmt then compares x w/ x, so the right func() is called.
K'vin